﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JXT.PrimaryKey.Batman.ObjectConverter;
using JXT.PrimaryKey.Batman.Domain.UserSystem.Models;
using DTO = JXT.PrimaryKey.Batman.WcfService.Models.UserSystem;

namespace JXT.PrimaryKey.Batman.WcfService.Services.Converters.UserSystem
{
    public class UserDetailConverter : AutoConvertableBase<UserDetail, DTO.UserDetail, UserDetailConverter>, IConvertable<UserDetail, DTO.UserDetail>
    {
        protected override void BuildExpressionConverter(IObjectConverter<UserDetail, DTO.UserDetail> converter)
        {
            base.BuildExpressionConverter(converter);
            converter.Add(e => e.Gender, e => e.Gender, e => (DTO.Gender)((byte)e));
        }

        protected override void BuildExpressionBackConverter(IObjectConverter<DTO.UserDetail, UserDetail> backConverter)
        {
            base.BuildExpressionBackConverter(backConverter);
            backConverter.Add(e => e.Gender, e => e.Gender, e => (Gender)((byte)e));
        }
    }
}
